---
category: DOM
created: '2020-04-19'
title: Detect macOS browser
updated: '2021-10-13'
---

**JavaScript version**

```js isMacBrowser.js
const isMacBrowser = /Mac|iPod|iPhone|iPad/.test(navigator.platform);
```

**TypeScript version**

```ts isMacBrowser.ts
const isMacBrowser: boolean = /Mac|iPod|iPhone|iPad/.test(navigator.platform);
```
